package com.leapp.sk.ui.adapter

import android.content.Context
import com.example.mvp.adapter.BaseLibMultipleViewAdapter
import com.example.mvp.binder.BaseDataBinder
import com.example.mvp.delegate.BaseAdapterDelegate
import com.example.mvp.bean.ClassMemberInfoEntity
import com.leapp.sk.binder.BaseBinder
import com.leapp.sk.viewdelegate.adapter.classs.ClassDetialTecherAdapterDelegate

/**
 * 班级老师适配器
 * @author  chaohaipeng  on 2018/7/30.
 */
class ClassThecherAdapter(context: Context, mlist: List<ClassMemberInfoEntity>) :BaseLibMultipleViewAdapter<ClassMemberInfoEntity>(context, mlist){
    /**
     * 数据
     */
    val mList = mlist
    /**
     * 上下文
     */
    val mContext = context
    override fun bindEvenListener(viewDelegate: BaseAdapterDelegate?, position: Int) {
    }

    override fun notifyView(viewDelegate: BaseAdapterDelegate?, position: Int) {
        if (viewDelegate is ClassDetialTecherAdapterDelegate){
            viewDelegate.setData(mContext,mList.get(position))

        }

    }

    override fun getDelegate(position: Int): BaseAdapterDelegate {
        return ClassDetialTecherAdapterDelegate::class.java?.newInstance()
    }

    override fun getDataBinder(position: Int): BaseDataBinder<*, *> {
        return BaseBinder()
    }

    override fun getItemData(position: Int): Any {
        return mList.get(position)
    }
}